#include "clinethread.h"
#include <qmath.h>
#include <qdebug.h>
CLineThread::CLineThread(QList <PointStream *>* vt_data , QObject *parent):
    QThread(parent)
{
    m_bool = true;
    m_Count = 0;
    m_streamList = vt_data;
}
CLineThread::~CLineThread()
{

}
void CLineThread::run()
{

    while( m_bool )   //循环
    {
        msleep(10);
        const double sineFrequency = 2.0; // 2Hz
        const double phase = 0.0;

        for(int i=0; i<m_streamList->size(); i++) {
            double value = qSin(2.0*M_PI*sineFrequency*sampleNumber*(((double)SAMPLE_GENERATION_PERIOD/1000.0) ));
            qDebug() << sampleNumber << value;
            QPointF data(sampleNumber, value);
            m_streamList->at(i)->appendPoints(data);
        }

        sampleNumber++;
        emit updatePlot();
    }
}
